<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>运单管理</title>
	<meta name="decorator" content="ani"/>
	<script type="text/javascript">
		var validateForm;
		var $table; // 父页面table表格id
		var $topIndex;//弹出窗口的 index
		function doSubmit(table, index){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $table = table;
			  $topIndex = index;
			  jp.loading();
			  $("#inputForm").submit();
			  return true;
		  }

		  return false;
		}

		$(document).ready(function() {
			validateForm = $("#inputForm").validate({
				submitHandler: function(form){
					jp.post("${ctx}/tms/newBill/save",$('#inputForm').serialize(),function(data){
						if(data.success){
	                    	$table.bootstrapTable('refresh');
	                    	jp.success(data.msg);
	                    	jp.close($topIndex);//关闭dialog

	                    }else{
            	  			jp.error(data.msg);
	                    }
					})
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
	        $('#dthd').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#lkthd').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#dshd').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#lkshd').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#zxsj').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#yjdd').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#qssj').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#dgssj').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#dhzsj').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
		});
	</script>
</head>
<body class="bg-white">
		<form:form id="inputForm" modelAttribute="newBill" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>
			<table class="table table-bordered">
				<tr>
					<td class="width-10 active"><label class="pull-right">委托单状态：</label></td>
					<td class="width-23">
						<form:input path="status" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-10 active"><label class="pull-right">投保状态：</label></td>
					<td class="width-23">
						<form:input path="bx" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-10 active"><label class="pull-right">合同号：</label></td>
					<td class="width-23">
						<form:input path="hth" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>

				<tr>
					<td class="width-10 active"><label class="pull-right">运单号：</label></td>
					<td class="width-23">
						<form:input path="ydh" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-10 active"><label class="pull-right">派车单号：</label></td>
					<td class="width-23">
						<form:input path="pcdh" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-10 active"><label class="pull-right">项目：</label></td>
					<td class="width-23">
						<form:input path="pro" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
				<tr>
					<td class="width-10 active"><label class="pull-right">下单日期：</label></td>
					<td class="width-23">
						<div class='input-group form_datetime' id='date'>
							<input type='text'  name="date" class="form-control"  value="<fmt:formatDate value="${newBill.date}" pattern="yyyy-MM-dd"/>"/>
							<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
						</div>

					</td>
					<td class="width-10 active"><label class="pull-right">要求发货日期：</label></td>
					<td class="width-23">
						<div class='input-group form_datetime' id='fhdate'>
							<input type='text'  name="fhdate" class="form-control"  value="<fmt:formatDate value="${newBill.fhdate}" pattern="yyyy-MM-dd"/>"/>
							<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
						</div>

					</td>
					<td class="width-10 active"><label class="pull-right">要求到货日期：</label></td>
					<td class="width-23">
						<div class='input-group form_datetime' id='dhdate'>
							<input type='text'  name="dhdate" class="form-control"  value="<fmt:formatDate value="${newBill.dhdate}" pattern="yyyy-MM-dd"/>"/>
							<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
						</div>

					</td>
				</tr>
				<tr>
					<td class="width-10 active"><label class="pull-right">订单类型：</label></td>
					<td class="width-23">
						<form:input path="type" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-10 active"><label class="pull-right">装运单号：</label></td>
					<td class="width-23">
						<form:input path="zydh" htmlEscape="false"    class="form-control "/>
					</td>

					<td class="width-10 active"><label class="pull-right">收货单位：</label></td>
					<td class="width-23">
						<form:input path="shdw" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-10 active"><label class="pull-right">收货详细地址：</label></td>
					<td class="width-23">
						<form:input path="site" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-10 active"><label class="pull-right">运输线路：</label></td>
					<td class="width-23">
						<form:input path="ysxl" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
			</table>
			<ul class="nav nav-tabs">
				<li class="active"><a data-toggle="tab" href="#tab-01" aria-expanded="true">订单详情</a>
				</li>
				<li class=""><a data-toggle="tab" href="#tab-02" aria-expanded="true">服务信息</a>
				</li>
				<li class=""><a data-toggle="tab" href="#tab-03" aria-expanded="true">配载信息</a>
				</li>
				<li class=""><a data-toggle="tab" href="#tab-04" aria-expanded="true">费用信息</a>
				</li>
					<li class=""><a data-toggle="tab" href="#tab-05" aria-expanded="true">在途跟踪</a>
					</li>
					<li class=""><a data-toggle="tab" href="#tab-06" aria-expanded="true">回单签收</a>
					</li>
			</ul>
		<div class="tab-content">
			<div id="tab-01" class="tab-pane fade in  active">
				<table class="table table-bordered">
					<tbody>


					<tr>
						<td class="width-10 active"><label class="pull-right">委托单号：</label></td>
						<td class="width-23">
							<form:input path="wtdh" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">提货单号：</label></td>
						<td class="width-23">
							<form:input path="thdh" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">物料编码：</label></td>
						<td class="width-23">
							<form:input path="code" htmlEscape="false"    class="form-control "/>
						</td>
					</tr>
					<tr>
						<td class="width-10 active"><label class="pull-right">物料名称：</label></td>
						<td class="width-23">
							<form:input path="name.name" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">规格：</label></td>
						<td class="width-23">
							<form:input path="gg" htmlEscape="false"    class="form-control "/>
						</td>

						<td class="width-10 active"><label class="pull-right">物料类型：</label></td>
						<td class="width-23">
							<form:input path="lx" htmlEscape="false"    class="form-control "/>
						</td>

					</tr>
					<tr>
						<td class="width-10 active"><label class="pull-right">单位：</label></td>
						<td class="width-23">
							<form:input path="unit" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">派车量：</label></td>
						<td class="width-23">
							<form:input path="pcl" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">装车量：</label></td>
						<td class="width-23">
							<form:input path="zcl" htmlEscape="false"    class="form-control "/>
						</td>
					</tr>
					<tr>
						<td class="width-10 active"><label class="pull-right">毛重：</label></td>
						<td class="width-23">
							<form:input path="weight" htmlEscape="false"    class="form-control "/>
						</td>


						<td class="width-10 active"><label class="pull-right">体积：</label></td>
						<td class="width-23">
							<form:input path="voulm" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">提货仓库：</label></td>
						<td class="width-23">
							<form:input path="deop.store" htmlEscape="false"    class="form-control "/>
						</td>
					</tr>
					</tbody></table>

			</div>
			<div id="tab-02" class="tab-pane fade">

				<table class="table table-bordered"><tbody>

				<tr>
					<td class="width-10 active"><label class="pull-right">起运地：</label></td>
					<td class="width-23">
						<form:input path="qyd.name" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">到站省：</label></td>
					<td class="width-35">
						<form:input path="dzs" htmlEscape="false"    class="form-control "/>
					</td>

					<td class="width-10 active"><label class="pull-right">到站地城市：</label></td>
					<td class="width-23">
						<form:input path="dzdcs" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
				<tr>
					<td class="width-10 active"><label class="pull-right">结算地：</label></td>
					<td class="width-23">
						<form:input path="jsd.name" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-10 active"><label class="pull-right">合同里程：</label></td>
					<td class="width-23">
						<form:input path="htlc" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-10 active"><label class="pull-right">作业类型：</label></td>
					<td class="width-23">
						<form:input path="zylx" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
				<tr>
					<td class="width-10 active"><label class="pull-right">运输方式：</label></td>
					<td class="width-23">
						<form:input path="ysfs" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-10 active"><label class="pull-right">收货单位确认人：</label></td>
					<td class="width-23">
						<form:input path="qrr" htmlEscape="false"    class="form-control "/>
					</td>

					<td class="width-10 active"><label class="pull-right">确认人电话：</label></td>
					<td class="width-23">
						<form:input path="qrrdh" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
				<tr>
					<td class="width-10 active"><label class="pull-right">客户特殊需求：</label></td>
					<td class="width-89" colspan="5">
						<form:input path="khtstq" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
				<tr>
					<td class="width-10 active"><label class="pull-right">结算方式：</label></td>
					<td class="width-23">
						<form:input path="jsfs" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-10 active"><label class="pull-right">结算类型：</label></td>
					<td class="width-23">
						<form:input path="jslx" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-10 active"><label class="pull-right">结算吨位区间：</label></td>
					<td class="width-23">
						<form:input path="width" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>

				</tbody></table>
			</div>
			<div id="tab-03" class="tab-pane fade ">
				<table class="table table-bordered">
					<tbody>
					<tr>
						<td class="width-10 active"><label class="pull-right">调度人员：</label></td>
						<td class="width-23">
							<form:input path="ddry.name" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">现场督导：</label></td>
						<td class="width-23">
							<form:input path="xxdd.name" htmlEscape="false"    class="form-control "/>
						</td>

						<td class="width-10 active"><label class="pull-right">托运类型：</label></td>
						<td class="width-23">
							<form:input path="tylx" htmlEscape="false"    class="form-control "/>
						</td>

					</tr>
					<tr>
						<td class="width-10 active"><label class="pull-right">承运商：</label></td>
						<td class="width-23">
							<form:input path="cys" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">承运商联系人：</label></td>
						<td class="width-23">
							<form:input path="cyslxr" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">承运商电话：</label></td>
						<td class="width-23">
							<form:input path="cysdh" htmlEscape="false"    class="form-control "/>
						</td>
					</tr>
					<tr>
						<td class="width-10 active"><label class="pull-right">车牌号：</label></td>
						<td class="width-23">
							<form:input path="cph" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">车辆类型：</label></td>
						<td class="width-23">
							<form:input path="cllx" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">行驶证号：</label></td>
						<td class="width-23">
							<form:input path="xszh" htmlEscape="false"    class="form-control "/>
						</td>
					</tr>

					<tr>
						<td class="width-10 active"><label class="pull-right">司机姓名：</label></td>
						<td class="width-23">
							<form:input path="sjxm" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">司机电话：</label></td>
						<td class="width-23">
							<form:input path="sjdh" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">驾驶证号：</label></td>
						<td class="width-23">
							<form:input path="jszh" htmlEscape="false"    class="form-control "/>
						</td>
					</tr>
					<tr>
						<td class="width-10 active"><label class="pull-right">绩效吨位区间：</label></td>
						<td class="width-23">
							<form:input path="jxdwqj" htmlEscape="false"    class="form-control "/>
						</td>

					</tr>
					</tbody>
				</table>
			</div>
			<div id="tab-04" class="tab-pane fade ">
				<table class="table table-bordered">
					<tbody>
					<tr>

						<td class="width-10 active"><label class="pull-right">装货付款：</label></td>
						<td class="width-23">
							<form:input path="zhfk" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">现金(装货)：</label></td>
						<td class="width-23">
							<form:input path="xjzh" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">油卡金额（装货）：</label></td>
						<td class="width-23">
							<form:input path="ykzh" htmlEscape="false"    class="form-control "/>
						</td>
					</tr>
					<tr>
						<td class="width-10 active"><label class="pull-right">货到付款：</label></td>
						<td class="width-23">
							<form:input path="hdfk" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">凭回执结算：</label></td>
						<td class="width-23">
							<form:input path="hzjs" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">合同费用：</label></td>
						<td class="width-23">
							<form:input path="htfy" htmlEscape="false"    class="form-control "/>
						</td>
					</tr>
					<tr>
						<td class="width-10 active"><label class="pull-right">租车费用：</label></td>
						<td class="width-23">
							<form:input path="zcfy" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">租车协议号：</label></td>
						<td class="width-23">
							<form:input path="zcxyh" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">总运费：</label></td>
						<td class="width-23">
							<form:input path="zyf" htmlEscape="false"    class="form-control "/>
						</td>
					</tr>


					</tbody>
				</table>

			</div>



			<div id="tab-05" class="tab-pane fade">
				<table class="table table-bordered">
					<tbody>
					<tr>
						<td class="width-15 active"><label class="pull-right">到提货地时间：</label></td>
						<td class="width-35">

							<div class='input-group form_datetime' id='dthd'>
								<input type='text'  name="dthd" class="form-control"  value="<fmt:formatDate value="${newBill.dthd}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
								<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
							</div>

						</td>
						<td class="width-15 active"><label class="pull-right">离开提货地时间：</label></td>
						<td class="width-35">

							<div class='input-group form_datetime' id='lkthd'>
								<input type='text'  name="lkthd" class="form-control"  value="<fmt:formatDate value="${newBill.lkthd}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
								<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
							</div>

						</td>
					</tr>
					<tr>
						<td class="width-15 active"><label class="pull-right">到收货地时间：</label></td>
						<td class="width-35">

							<div class='input-group form_datetime' id='dshd'>
								<input type='text'  name="dshd" class="form-control"  value="<fmt:formatDate value="${newBill.dshd}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
								<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
							</div>

						</td>
						<td class="width-15 active"><label class="pull-right">离开收货地时间：</label></td>
						<td class="width-35">

							<div class='input-group form_datetime' id='lkshd'>
								<input type='text'  name="lkshd" class="form-control"  value="<fmt:formatDate value="${newBill.lkshd}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
								<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
							</div>

						</td>
					</tr>
					<tr>
						<td class="width-15 active"><label class="pull-right">最新跟踪时间：</label></td>
						<td class="width-35">

							<div class='input-group form_datetime' id='zxsj'>
								<input type='text'  name="zxsj" class="form-control"  value="<fmt:formatDate value="${newBill.zxsj}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
								<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
							</div>

						</td>
						<td class="width-15 active"><label class="pull-right">最新跟踪位置：</label></td>
						<td class="width-35">
							<form:input path="zxwz" htmlEscape="false"    class="form-control "/>
						</td>
					</tr>
					<tr>
						<td class="width-15 active"><label class="pull-right">预计到达客户时间：</label></td>
						<td class="width-85" colspan="3">

							<div class='input-group form_datetime' id='yjdd'>
								<input type='text'  name="yjdd" class="form-control"  value="<fmt:formatDate value="${newBill.yjdd}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
								<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
							</div>

						</td>
					</tr>
					</tbody>
				</table>
				<div style="height:40px;"></div>
				<table class="table table-bordered">
					<tr>
						<th>序号</th>
						<th>跟踪类型</th>
						<th>跟踪时间</th>
						<th>跟踪位置</th>
						<th>备注</th>
					</tr>
					<c:forEach varStatus="index" items="${list}" var="node">
						<tr>
							<td>${index.index+1}</td>
							<td>${node.lx}</td>
							<td><fmt:formatDate value="${node.sj}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
							<td>${node.wz}</td>
							<td>${node.remarks}</td>

						</tr>
					</c:forEach>
				</table>
			</div>
			<div id="tab-06" class="tab-pane fade">
				<table class="table table-bordered">
					<tbody>
					<tr>

						<td class="width-10 active"><label class="pull-right">客户签收状态：</label></td>
						<td class="width-23">
							<form:input path="qszt" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">签收时间：</label></td>
						<td class="width-23">

							<div class='input-group form_datetime' id='qssj'>
								<input type='text'  name="qssj" class="form-control"  value="<fmt:formatDate value="${newBill.qssj}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
								<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
							</div>

						</td>
						<td class="width-10 active"><label class="pull-right">客户签收人：</label></td>
						<td class="width-23">
							<form:input path="qsr" htmlEscape="false"    class="form-control "/>
						</td>
					</tr>

					<tr>
						<td class="width-10 active"><label class="pull-right">客户签收备注：</label></td>
						<td class="width-23">
							<form:input path="remarks" htmlEscape="false"    class="form-control "/>
						</td>
						<td class="width-10 active"><label class="pull-right">回单到公司时间：</label></td>
						<td class="width-23">
							<p class="input-group">
							<div class='input-group form_datetime' id='dgssj'>
								<input type='text'  name="dgssj" class="form-control"  value="<fmt:formatDate value="${newBill.dgssj}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
								<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
							</div>
							</p>
						</td>
						<td class="width-10 active"><label class="pull-right">回单到货主时间：</label></td>
						<td class="width-23">
							<p class="input-group">
							<div class='input-group form_datetime' id='dhzsj'>
								<input type='text'  name="dhzsj" class="form-control"  value="<fmt:formatDate value="${newBill.dhzsj}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
								<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
							</div>
							</p>
						</td>
					</tr>
					</tbody>
				</table>
			</div>


		</div>

	</form:form>
</body>
</html>